this._updateAlwaysZoom();
global.screen.connect('monitors-changed', Lang.bind(this, this._updateAlwaysZoom));
+ global.screen.connect('notify::n-workspaces',
+ Lang.bind(this, this._workspacesChanged));
+
Main.xdndHandler.connect('drag-begin', Lang.bind(this, function(){
this._alwaysZoomOut = true;
}));
this._updateAlwaysZoom();
}));
- this._nWorkspacesNotifyId = 0;
this._switchWorkspaceNotifyId = 0;
this._itemDragBeginId = 0;
this.workspacesView = new WorkspacesView(this._workspaces);
this._updateWorkspacesGeometry();
- this._nWorkspacesNotifyId =
- global.screen.connect('notify::n-workspaces',
- Lang.bind(this, this._workspacesChanged));
-
this._restackedNotifyId =
global.screen.connect('restacked',
Lang.bind(this, this._onRestacked));
this._controls.hide();
this._thumbnailsBox.hide();
- if (this._nWorkspacesNotifyId > 0) {
- global.screen.disconnect(this._nWorkspacesNotifyId);
- this._nWorkspacesNotifyId = 0;
- }
if (this._restackedNotifyId > 0){
global.screen.disconnect(this._restackedNotifyId);
this._restackedNotifyId = 0;
if (oldNumWorkspaces == newNumWorkspaces)
return;
+ this._updateAlwaysZoom();
+ this._updateZoom();
+
+ if (this.workspacesView == null)
+ return;
+
let lostWorkspaces = [];
if (newNumWorkspaces > oldNumWorkspaces) {
// Assume workspaces are only added at the end
this.workspacesView.updateWorkspaces(oldNumWorkspaces,
newNumWorkspaces);
- this._updateAlwaysZoom();
- this._updateZoom();
},
_updateZoom : function() {